<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }
        .nav {
            width: 1050px;
            height: 50px;
            border: 5px solid #3ef929;
            margin: 100px auto;
        }
        .nav ul li {
            list-style: none;
        }
        .nav ul li a {
            display: block;
            width: 120px;
            height: 50px;
            border: 2px solid #7229f9;
          
          /*让内容水平居中*/
			text-align: center;
			/*让行高等于nav的高度，就可以保证内容垂直居中*/
			line-height: 50px;
        }

        li {
            float: left;
            display: block;
            width: 120px;
            height: 50px;
            border: 5px solid #f92929;
        }

        .nav ul li a:link, .nav ul li a:visited {
            text-decoration: none;
            background-color: #7229f9;
            color: white;
        }

        .nav ul li a:hover{
			background-color: orange;
		}

    </style>
</head>
<body>
    <div class="nav">
        <ul>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
        </ul>
    </div>
</body>
</html>